Skip to content

feat(DTOSS-13037): automate Arc machine app role assignment and enterprise app ownership - #117

Merged
josielsouzanordcloud merged 1 commit into
mainfrom
DTOSS-13037/automate-arc-app-role-assignment
Jun 4, 2026
Merged

feat(DTOSS-13037): automate Arc machine app role assignment and enterprise app ownership#117
josielsouzanordcloud merged 1 commit into
mainfrom
DTOSS-13037/automate-arc-app-role-assignment

Conversation

@josielsouzanordcloud

@josielsouzanordcloud josielsouzanordcloud commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds scripts/bash/assign_arc_app_roles.sh to assign the Gateway.Access app role to all Arc-enabled server managed identities; called automatically from make <env> resource-group-init
  • Bicep Graph extension (enterpriseAppOwner.bicep) manages pipeline MI and screening group members as owners of spn-manbrs-web-api-<env> service principal and application registration
  • Removes azuread_app_role_assignment from Terraform — the pipeline MI cannot create app role assignments (AppRoleAssignment.ReadWrite.All is required in application auth context regardless of SP ownership, and is not permitted under the organisation's Entra policy)

Test plan

  • Run make review resource-group-init and confirm the Arc machine appears in Enterprise Applications → spn-manbrs-web-api-review → Users and groups with the Gateway.Access role
  • Verify bicep build compiles main.bicep without errors
  • Confirm Terraform plan has no azuread_app_role_assignment resources

@josielsouzanordcloud
josielsouzanordcloud force-pushed the DTOSS-13037/automate-arc-app-role-assignment branch from 65e9473 to 4aad077 Compare June 2, 2026 09:08
@josielsouzanordcloud
josielsouzanordcloud force-pushed the DTOSS-13037/automate-arc-app-role-assignment branch from de13a78 to a768d43 Compare June 2, 2026 12:19
@josielsouzanordcloud
josielsouzanordcloud force-pushed the DTOSS-13037/automate-arc-app-role-assignment branch from e1c6a9a to 0071893 Compare June 2, 2026 14:40
@josielsouzanordcloud josielsouzanordcloud changed the title feat(DTOSS-13037): automate app role assignment for Arc machine managed identities feat(DTOSS-13037): automate Arc machine app role assignment and enterprise app ownership Jun 2, 2026
@josielsouzanordcloud
josielsouzanordcloud force-pushed the DTOSS-13037/automate-arc-app-role-assignment branch 2 times, most recently from 78a9d50 to 6c2070f Compare June 2, 2026 15:32
…prise app ownership

Automates the Gateway.Access app role assignment for Arc-enabled server
managed identities and ownership of the enterprise app spn-manbrs-web-api-<env>.

App role assignment is intentionally not automated via the Terraform pipeline.
Microsoft Graph requires AppRoleAssignment.ReadWrite.All in application auth
context to create app role assignments — service principal ownership is
insufficient. This permission is not permitted under the organisation's Entra
policy. Instead, assign_arc_app_roles.sh runs under delegated user credentials
(where SP ownership is sufficient) and is called automatically by
`make <env> resource-group-init`.

Changes:
- Arc machine managed identity app role assignment moved from Terraform
  (azuread_app_role_assignment) to scripts/bash/assign_arc_app_roles.sh,
  called as part of resource-group-init
- Bicep Graph extension manages pipeline MI and screening group members as
  owners of the enterprise app service principal and application registration
- Onboard Hospital VM runbook updated with Step 4 (Grant API access)
- Deployment pipeline and create-environment docs updated to explain the
  permission limitation and required manual steps
@josielsouzanordcloud
josielsouzanordcloud force-pushed the DTOSS-13037/automate-arc-app-role-assignment branch from 6c2070f to 49d7ad9 Compare June 4, 2026 08:47

@steventux steventux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇 for docs

@josielsouzanordcloud
josielsouzanordcloud merged commit 468a169 into main Jun 4, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants